$.ajaxSetup ({cache: false});

var ajax_load = "<img class='loading' src='modules/reequipment/xarimages/ajax-loader.gif' alt='loading...' style='padding-left: 50px; padding-top: 50px;' />";
var update_load = "<img class='loading' src='modules/reequipment/xarimages/ajax-loader.gif' alt='loading...'  /> Updating...";
var finished = ' ';

function UpdateInvoice(item_id){
    var loadUrl = 'index.php?module=reequipment&type=user&func=items&phase=ajax_update&pageName=module';
    $("#items_form_updating").fadeIn().html(update_load).delay("500").fadeOut('slow');
    $.post(
        loadUrl,
        $("#invoice_form_"+item_id).serialize()
        );
}

function UpdateShipping(item_id){
    var loadUrl = 'index.php?module=reequipment&type=user&func=items&phase=ajax_shipping&pageName=module';
    $("#items_form_updating").fadeIn().html(update_load).delay("500").fadeOut('slow');
    $.post(
        loadUrl,
        $("#invoice_form_"+item_id).serialize()
        );
}

function UpdateOrder(order_id){
    var loadUrl = 'index.php?module=reequipment&type=user&func=orders&phase=ajax_update&pageName=module';
    $("#items_form_updating").fadeIn().html(update_load).delay("500").fadeOut('slow');
    $.post(
        loadUrl,
        $("#order_form_"+order_id).serialize()
        );
}

function CreateInvoice(order_id){
    var loadUrl = 'index.php?module=reequipment&type=user&func=items&phase=create_invoice&pageName=module';
    $("#items_form_updating").fadeIn().html(update_load).delay("500").fadeOut('slow');
    $.post(
        loadUrl,
        $("#order_form_"+order_id).serialize()
        );
}

function CreateInventoryOrder(){
    var loadUrl = 'index.php?module=reequipment&type=user&func=orders&phase=create&pageName=module';
    $("#order_form").fadeOut('Slow');
    $("#creating_order").fadeIn().html(update_load).delay("500").fadeOut('slow');
    $.post(
        loadUrl,
        $("#create_order").serialize()
    );
    document.getElementById('create_order').reset()
    $("#order_form").fadeIn('Slow');
}